Vegetation Index · RGB-based
NDGI – Normalized Difference Greenness Index
NDGI is a vegetation index based on visible green and red reflectance, designed to quantify
greenness when NIR bands are not available. It works perfectly on RGB satellite or drone imagery.
1. Scientific Definition
The Normalized Difference Greenness Index (NDGI) measures vegetation greenness
using the Red and Green bands. It is especially useful when only visible spectrum data is
available (RGB cameras, drones, some satellite composites).
Formula
A commonly used formulation of NDGI is:
NDGI = (Green − Red) / (Green + Red)
Dimensionless (–1 to +1)
Where:
Green : Green band reflectance
Red : Red band reflectance
Typical Interpretation
NDGI Range
Interpretation
< 0.0
Water, shadows, non-vegetated dark surfaces
0.0 – 0.1
Very sparse vegetation / bare soil
0.1 – 0.3
Low to moderate vegetation greenness
> 0.3
Dense and healthy green vegetation
Key Applications
Vegetation mapping from RGB drone imagery
Crop monitoring where NIR is not available
Urban greenness assessment (parks, street vegetation)
Quick vegetation screening in high-resolution RGB imagery
2. Data & Bands for NDGI
Common Sensors & Bands
Sentinel-2 (ESA) – 10 m
Green: B3 (~560 nm)
Red: B4 (~665 nm)
Landsat 8/9 OLI – 30 m
UAV / RGB cameras
Use R & G reflectance from calibrated RGB images
Good Practice
Use surface reflectance when available.
Remove shadows and dark pixels to improve output quality.
Clip NDGI raster to AOI before export.
Palette Suggestion
Suggested NDGI palette:
[ "#440154", "#3b528b", "#21908c", "#5dc963", "#fde725" ]
Steps: open code.earthengine.google.com → New Script → paste the code →
draw your AOI as geometry → Run → Export NDGI as GeoTIFF.
// NDGI for any AOI using Sentinel-2 SR
//-------------------------------------------------------
// Define AOI
var roi = geometry;
// Center map
Map.centerObject(roi, 11);
// Time range
var startDate = '2023-01-01';
var endDate = '2023-12-31';
// Load Sentinel-2 SR
var s2 = ee.ImageCollection('COPERNICUS/S2_SR')
.filterBounds(roi)
.filterDate(startDate, endDate)
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20))
.select(['B3', 'B4']); // Green, Red
var image = s2.median().clip(roi);
// NDGI = (Green - Red) / (Green + Red)
var ndgi = image.expression(
'(G - R) / (G + R)',
{
'G': image.select('B3'),
'R': image.select('B4')
}
).rename('NDGI');
// Visualization
var ndgiVis = {
min: -1,
max: 1,
palette: [
'#440154',
'#3b528b',
'#21908c',
'#5dc963',
'#fde725'
]
};
Map.addLayer(ndgi, ndgiVis, 'NDGI');
// True Color preview
var rgb = ee.ImageCollection('COPERNICUS/S2_SR')
.filterBounds(roi)
.filterDate(startDate, endDate)
.select(['B4','B3','B2'])
.median()
.clip(roi);
Map.addLayer(rgb, {min:0, max:3000}, 'RGB', false);
// Export
Export.image.toDrive({
image: ndgi,
description: 'NDGI_Export',
fileNamePrefix: 'NDGI_Export',
region: roi,
scale: 10,
crs: 'EPSG:4326',
maxPixels: 1e13
});
NDGI vegetation index reference by Start4IT.